﻿using System;
using System.Globalization;
using Microsoft.Samples.WindowsPhoneCloud.StorageClient;
using System.Data.Services.Common;

namespace BathroomLocator.Phone.Models
{
	[DataServiceEntity]
	[EntitySet("BathroomLocation")]
	public class BathroomLocation : TableServiceEntity
	{
		private string gpsLat;
		private string gpsLong;
		private string facilityName;
		private int rating;
		private string city;
		private string state;
		private string addressLine1;
		private string zipCode;
		private string comment;
        private string imagePath;

		public BathroomLocation()
			: base("bathroom", string.Format(CultureInfo.InvariantCulture, "{0:10}_{1}", DateTime.MaxValue.Ticks - DateTime.Now.Ticks, Guid.NewGuid()))
		{
		}

        public BathroomLocation(string partitionKey, string rowKey)
            : base(partitionKey, rowKey)
        {

        }

		public string GPSLatitude 
		{ 
			get {return this.gpsLat;}
			set
			{
				this.gpsLat = value;
				this.OnPropertyChanged("GPSLatitude");
			}
		}

		public string GPSLongitude 
		{
			get { return this.gpsLong; }
			set
			{
				this.gpsLong = value;
				this.OnPropertyChanged("GPSLongitude"); 
			}
		}

		public string FacilityName
		{
			get { return this.facilityName; }
			set
			{
				this.facilityName = value;
				this.OnPropertyChanged("FacilityName");
			} 
		}

		public string Comment
		{
			get { return this.comment; }
			set
			{
				this.comment = value;
				this.OnPropertyChanged("Comment");
			}
		}

		public int Rating
		{ 
			get { return this.rating;} 
			set 
			{
				this.rating = value;
				this.OnPropertyChanged("Rating");
			}
		}

		public string City
		{ 
			get {return this.city;}
			set
			{
				this.city = value;
				this.OnPropertyChanged("City");
			}
		}

		public string State
		{ 
			get {return this.state;}
			set 
			{
				this.state = value;
				this.OnPropertyChanged("State");
			}
		}

		public string AddressLine1
		{ 
			get { return this.addressLine1;}
			set
			{
				this.addressLine1 = value;
				this.OnPropertyChanged("AddressLine1");
			}
		}

		public string ZipCode
		{
			get { return this.zipCode; }
			set 
			{
				this.zipCode = value;
				this.OnPropertyChanged("ZipCode");
			}
		}

        public string ImagePath
        {
            get { return this.imagePath; }

            set
            {
                this.imagePath = value;
                this.OnPropertyChanged("ImagePath");
            }
        }
	}
}
